export default {
  name: 'taskList',
  props: {
    modelData: {}
  },
  data() {
    return {
      assortUsr: ['待接收', '执行中', '已执行'],
      assortAdmin: ['待审核', '待接收', '执行中', '已闭环'],
      effect: '影响运营',
      expired: '超时',
      statusListUsr: ['待接收', '执行中', '待审核', '完成', '失败'],
      statusListAdmin: ['待审核', '待接收', '执行中', '完成', '失败', '驳回']
    }
  },
  computed: {
    assort() {
      if (this.$globaldata.limits === 'usr') {
        return this.assortUsr
      } else {
        return this.assortAdmin
      }
    },
    statusList() {
      if (this.$globaldata.limits === 'usr') {
        return this.statusListUsr
      } else {
        return this.statusListAdmin
      }
    },
    assortCount() {
      let arr = new Array(this.assort.length);
      arr.fill(0);
      try {
        this.modelData.data.forEach(o => {
          for (let i in arr) {
            if (o.status === Number(i)) {
              arr[i] += 1
            } else if(Number(i)===arr.length-1 && o.status>Number(i)) {
              arr[arr.length-1] += 1
            }
          }
        })
        return arr     
      } catch(err) {
        return arr
      }
    }
  }
}